package com.shoesmail.config;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;



@Configuration
public class RedisConfig {
    @Value("${redission.config.address}")
    private String redisAddress;

    @Value("${redission.config.password}")
    private String redisPassword;

    @Value("${spring.redis.database}")
    private int dataBase;
    @Bean
    public RedissonClient redissonClient(){
        Config config = new Config();
        config.useSingleServer().setAddress(redisAddress).setPassword(redisPassword).setDatabase(dataBase);
        return Redisson.create(config);
    }
}

